package com.wus.common.web.config;

import com.wus.common.web.handler.UserContextInterceptor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: web配置
 * @Author: wus
 * @Date: 2024/12/17 11:27
 */
@AutoConfiguration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserContextInterceptor())
                // 拦截所有路径
                .addPathPatterns("/**");
    }
}
